package com.qys.training.biz.file.service;


import com.qys.training.base.config.Font;
import com.qys.training.base.config.PDFTextConfig;
import com.qys.training.biz.file.criteria.FileInfoCriteria;
import com.qys.training.biz.file.entity.FileInfo;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

public interface FileInfoService {

    /**
     * 插入文件
     * @param file
     * @return
     */
    Long create(MultipartFile file);

    /**
     * 根据Id查询 下载
     * @param id
     * @return
     */
    void downloadById(HttpServletRequest request, HttpServletResponse response, Long id);

    /**
     * 更新
     * @param id
     * @param file
     */
    void update(Long id,MultipartFile file);

    /**
     * 根据id删除
     * @param id
     */
    void delete(Long id);

    /**
     * 查询列表
     * @param criteria
     */
    Map findList(FileInfoCriteria criteria);

    /**
     * 根据id Zip下载
     * @param request
     * @param response
     * @param ids
     * @throws IOException
     */
    void downloadZip(HttpServletRequest request, HttpServletResponse response, List<Long> ids) throws IOException;

    /**
     *添加文字
     * @param id
     * @param text
     * @param x
     * @param y
     * @param font
     */
    void addText(Long id, String text, float x, float y, Font font);

}
